//var serverBaseUrl = 'http://vn-web-cleaner.appspot.com/';
var serverBaseUrl = 'http://dummy.com:8888/vn-web-cleaner/war/';
var basename = getInjectedFileBaseName();
var css = serverBaseUrl + 'sites/' + basename + '.less';
var lessScript = serverBaseUrl + 'libs/' + 'less-1.3.3.min.js';

//var link = '<link id="cinema-addons" href="' + css + '"  rel="stylesheet/less" type="text/css" />';
//$('head').append(link);

$.get(css, function (lesscss) {
    var html = '<style type="text/less">' + lesscss + '</style>';
    $('body').append(html);
});

var lessHtml = '<script id="cinema-addons" src="' + lessScript + '"  type="text/javascript"></script>';
$('head').append(lessHtml);


function getInjectedFileBaseName() {
    return window.location.host.replace(/^w{3}\./, '');
    var domain = window.location.host;
    var parts = domain.split('.');
    var filename = parts.pop();
    var host = parts.pop();
    if (host) {
        filename = host + '.' + filename;
    }

    return filename;

}